import request from "@/utils/request";

// 查询废料处理列表
export function listWaste(query) {
  return request({
    url: "/mes/waste/list",
    method: "get",
    params: query,
  });
}

// 结算：查询结算明细列表
export function listWasteJS(query) {
  return request({
    url: "/mes/waste/listJS",
    method: "get",
    params: query,
  });
}

// 查询废料处理详细
export function getWaste(id) {
  return request({
    url: "/mes/waste/" + id,
    method: "get",
  });
}

// 新增废料处理
export function addWaste(data) {
  return request({
    url: "/mes/waste",
    method: "post",
    data: data,
  });
}

// 修改废料处理
export function updateWaste(data) {
  return request({
    url: "/mes/waste",
    method: "put",
    data: data,
  });
}

// 删除废料处理
export function delWaste(id) {
  return request({
    url: "/mes/waste/" + id,
    method: "delete",
  });
}

// 导出
export const wasteExport = (data) => {
  return request({
    url: "mes/waste/export",
    method: "post",
    data,
    responseType: "blob",
  });
};

// 导出
export const exportDetail = (data) => {
  return request({
    url: "mes/waste/exportDetail",
    method: "post",
    data,
    responseType: "blob",
  });
};
// 查询废料处理明细列表
export function listDetail(query) {
  return request({
    url: "/mes/waste/detail",
    method: "get",
    params: query,
  });
}
